home *** CD-ROM | disk | FTP | other *** search
/ Magazyn WWW 1999 July / www_07_1999.iso / prog / mac / alpha / alpha.hqx / Alpha ƒ / Help / Alpha Manual < prev    next >
Text File  |  1998-12-19  |  86KB  |  1,997 lines

  1.       Copyright ⌐ 1990-1998 Pete Keleher. All Rights Reserved
  2.  
  3.           (For more help, look under the system help menu!)
  4.  
  5. The Author(s) of this product are in no way liable for any direct or 
  6. indirect damage caused by the product. 
  7.  
  8. You may freely copy and distribute Alpha, but please bear in mind that 
  9. Alpha is Shareware.  If you decide to keep it, please register your copy 
  10. by selecting 'Register' from the 'About╔' dialog.
  11.  
  12. I am collecting user-written Tcl procs at Alpha's home site.  If you have 
  13. written anything that you think may be of general interest, please send it 
  14. to me and I will make it available.
  15.  
  16. Alpha contains source from many places, but in particular I'm grateful to 
  17. Ray Johnson and Tim Endres for their working on porting TCL to the mac, and 
  18. to Tom Scavo and Tom Pollard for their Tcl code contributions.  The 
  19. following people have also provided considerable code and/or help debugging 
  20. the one or two bugs Alpha has had: Masatsugu Nagata, Karl J. Smith, Eric 
  21. Sink, David C. Black, Richard T. Austin, Henry Spencer, Vince Darley, 
  22. Johan Linde, Tom Fetherston, Jon Guyer and Jerry Fowler.
  23.  
  24. What to do: USE THE MARKS MENU IN THIS FILE!.  This file contains "marks" 
  25. in a popup menu above the vertical scrollbar on the right, that let you 
  26. jump to different sections of this file.  Mouse-down on the M icon.
  27.  
  28. Also, Alpha supports a limited form of hypertext. Clicking on green 
  29. underlined text executes a command associated with the underlined text, 
  30. usually taking you to other documentation. Control-<period> will bring you 
  31. back.  For example, clicking here takes you to more documentation of the 
  32. hypertext capabilities.  
  33.  
  34. Alpha's hypertext links can be used to perform arbitrary tasks, including 
  35. interaction with other applications.  Once you have Internet Config 
  36. installed, the following links will all be active:
  37.     Alpha's home site:        click here (or here if no Internet Config)
  38.     Mail to the author:        click here
  39.     
  40.  
  41. Alpha is a very powerful, multi-purpose editor that allows any program- 
  42. or user-defined function to be bound to any keystroke, or placed into 
  43. user-defined menus. Every menu is defined in the macro language Tcl by 
  44. one of the startup files ("AlphaBits.tcl" or one of the files sourced 
  45. from inside it). 
  46.  
  47. Alpha is multi-modal, which means it switches between different modes 
  48. depending on which type of document you are editing. Everybody who has used 
  49. Emacs knows about this concept. The idea with different modes is to change 
  50. Alpha's behavior depending on which kind of text you're editing. For 
  51. example if you're programming in C++ or editing a LaTeX document you of 
  52. course want different features.
  53.  
  54. Alpha uses Dr.  Ousterhout's Tool Command Language (Tcl) as an extension 
  55. language.  Click here for a more complete definition of the language.  Many 
  56. of the functions bound to keystrokes, as well as many of the functions in 
  57. the menus, are written in Tcl.
  58.  
  59. Of course, you don't have to learn Tcl to use Alpha. It is only needed if 
  60. you want to write your own extensions.
  61.  
  62. Callable functions in Alpha come in two different flavors.  First, there 
  63. are the basic Tcl commands, detailed here.  Second there are "Alpha commands",
  64. commands that relate specifically to Alpha. 
  65.  
  66. A good way to get to know the editor and the language is to try different 
  67. things out. Play around. Choose the menu item "Config:List All Bindings"
  68. to get a listing of all the current keystroke bindings. Look in 
  69. "alphaMenus.tcl" for definitions of most of the menus. See the section on 
  70. "GUI Details" for more information about the various pieces of Alpha's 
  71. windows. And finally, please feel free to send suggestions/"feature" 
  72. reports/questions to me at <keleher@cs.umd.edu>. I am not able to answer US 
  73. postal mail, but if you send it to me I will at least read it. Have fun!
  74.  
  75.  
  76.  
  77.           GUI Details
  78.  
  79. Alpha's interface has several non-standard features. First, there is a 
  80. status window across the bottom of the primary window.
  81.  
  82. Second, the horizontal scrollbar can be turned on and off via the window 
  83. menu. The default for subsequent windows is controlled via the 
  84. global variable 'horScrollBar' (look under "Config:Global:Preferences:Window").
  85.  
  86. Third, above the vertical scrollbar on the right is an icon with curly braces 
  87. ('{}'). This is the "Funcs" menu, which lists function definitions of the 
  88. the current window if the current mode is a programming language. By 
  89. default, the functions in this menu are sorted alphanumerically. This 
  90. feature can be turned off via the global flag 'sortFuncsMenu', making the 
  91. menu appear faster on slower machines.
  92.  
  93. Below the funcs menu is the "Marks" menu, which pops up over the icon with 
  94. the large 'M'. The "Marks" menu lists all marks for the current window, 
  95. and allows them to be cleared or automatically created (through the Tcl 
  96. proc 'markFile' that calls mode-specific routines). Above the "Funcs" menu, 
  97. a red disk icon appears if the window is currently dirty. Clicking on this 
  98. icon saves the file.
  99.  
  100. Directly above the vertical scrollbar is a black bar that can be used to 
  101. split any window into two independent panes showing the same buffer. 
  102. Windows are split by either dragging the black bar or using the 
  103. "Windows:Split Window" menu command. Windows are unsplit the same way. 
  104. Double-clicking on the bar can also be used to toggle whether the window 
  105. is split.
  106.  
  107. Clicking on the window name brings up a popup menu that shows the 
  108. complete pathname of the file.  Command-clicking anywhere else on the 
  109. titlebar brings up the mark menu. Option-clicking on the titlebar of a 
  110. window usually brings up a list of 'related' files.  What this means
  111. depends upon the current mode. (Some modes don't use this features to list 
  112. files, but list something else instead.) For programming modes like C, C++,
  113. Alpha asks your IDE: either the Symantec project manager or Metrowerks
  114. CW IDE for a list of include files and shows them.  For TeX mode Alpha
  115. lists all files which form part of the current document (if a 
  116. multi-part document).  A fallback is simply to list all files in the
  117. current folder, if a mode doesn't supply its own implementation.
  118.  
  119. Option-clicking and dragging text enables rectangular editing.
  120.  
  121. Control-double-clicking on any type of paren or bracket hilites from the 
  122. paren or bracket to its mate.  Without the control key held down, only the 
  123. intervening text is selected.
  124.  
  125. Command-clicking on a selection passes it to the Internet Config app. 
  126. Command-clicking on a URL, selected or not, also passes it to Internet Config.
  127.  
  128. Cmd-double-clicking in *any* mode will attempt to open a URL in the 
  129. surrounding text and send it to your web browser. If this fails, Alpha then 
  130. tries a mode-specific procedure.
  131.  
  132. Command-double clicking on a word in a C file will try to find the 
  133. definition of the word. The first option is looking up the word in the 
  134. tag file. If the word is not a tag, or no tags have been specified, Alpha 
  135. attempts to lookup the word through the THINK Reference app. If you would like 
  136. Apple's Toolbox Assistant to be used instead, edit the proc 
  137. 'C++::DblClick'. In Tcl mode, the verb is looked up in the Tcl folders, 
  138. then in ":Help:Alpha Commands", and then finally in ":Help:Tcl Commands".
  139.  
  140. Alpha also supports drag and drop editing.
  141.  
  142. The grow region in the lower right corner is replaced by a lock icon if the 
  143. file is read-only.  Read-only status can be changed by command-clicking in 
  144. this area.
  145.  
  146. See "Status Bar" for information describing the bar running across the 
  147. bottom of the screen.
  148.  
  149. Finally, Alpha provides many different ways to move windows around the 
  150. screen, most of which are accessible via the windows menu, i.e the menu 
  151. with the window icons. The first four items of the "Windows:Arrange" menu 
  152. move windows around a virtual box on the screen, defined by vars 
  153. 'tileLeft', 'tileRight', 'tileWidth', and 'tileHeight'. The first two 
  154. affect 'numWinsToTile' windows, the others always affect two. The gap 
  155. between windows is controlled by 'tileMargin' (vertical) and 'horMargin' 
  156. (horizontal). These can be used to allow for different window types, such 
  157. as the one in system 8.0 and the one in earlier systems. The 'Unequal Vert' and 
  158. 'Unequal Hor' items split the space between two windows, with the 
  159. proportion assigned to the first controlled by 'tileProportion'. All of 
  160. these variables can be changed via the "Config:Global:Preferences:Tiling" 
  161. dialog. 
  162.  
  163.  
  164.  
  165.           Searches
  166.  
  167. Alpha has a full repertoire of searching commands.  The 'find' command 
  168. brings up a dialog allowing the search and replacement text to be 
  169. specified.  The dialog also allows 'Forward', 'Ignore Case', 'Reg Expr', 
  170. and 'Word Match' options to be set.  These options can be toggled via the 
  171. keyboard by clover-<first letter of option>.  For example, clover-w toggles 
  172. the 'Word Match' option.
  173.  
  174. The 'Mult Files' option tells Alpha to search through all files in a given 
  175. file set.  Filesets can be specified (see the section on 
  176. filesets) via the "New Fileset╔" item of the "File 
  177. Sets:Utilities" sub-menu. Filesets can be chosen via the popup fileset menu.
  178.  
  179. In addition to the current filesets, the fileset menu has an entry called 
  180. "Directory Scan". Allows you to specify a folder that will be searched. 
  181. These folders are saved at the end of the menu for future searches.
  182.  
  183. Any search can also be a "Batch" search, a list of all matches in the 
  184. fileset or current window are displayed in a new window. A particular match 
  185. can be displayed by moving the cursor to a line in the file of matches and 
  186. selecting "Goto Match" from the Utils menu (also bound to "return").
  187.  
  188. And finally, Alpha allows a library of useful search and replace texts to 
  189. be defined as a tcl list of lists (each sublist containing a name, search 
  190. text, and replacement text). This list, the 'patternLibrary' variable 
  191. defined in 'search.tcl', is used to create a popup menu in the find dialog
  192. allowing these patterns to be easily entered.
  193.  
  194. Once the text and options have been set, the 'Search' menu contains several 
  195. commands for repeated searching, replacing, etc. 
  196.  
  197.  
  198.           Regular Expressions
  199.  
  200. If the variable 'regExpr' is true, the search functions interpret the 
  201. search text as regular expressions, which have the following elements:
  202.  
  203.  c        literal char.
  204.  ^        beginning of line.
  205.  $        end of line.
  206.  .        any character except carriage return.
  207.  [...]    character class, can use ranges such as '0-9'.
  208.           inside classes. Matches one character of the 
  209.           enclosed choices. Ex: '[ac0-2]' matches 'a', 
  210.           'c', '0', '1', or '2'.
  211.  [^...]   negated character class, matches anything but
  212.           the enclosed characters. ']' can be included
  213.           by putting it immediately after the '^'.
  214.  \t       tab.
  215.  \r       carriage return or line break.
  216.  *        zero or more occurrences of the previous
  217.           pattern. Ex: 'ab*' matches 'a', 'ab', 'abb',
  218.           'abbb' etc.
  219.  +        one or more occurrences of the previous 
  220.           pattern. 
  221.  ?        zero or one occurrences of the previous 
  222.           pattern. Ex: 'ab?' matches 'a' or 'ab'.
  223.  a|b      matches either a or b. If enclosed in
  224.           parenthesis, the extent of the alternated
  225.           expressions is limited. Ex: (pete|bob) 
  226.           matches either 'pete' or 'bob'.
  227.  (...)    The interior elements are grouped together. 
  228.  
  229. Regular expressions constructed from the above elements can be 
  230. concatenated to create larger expressions. 
  231.  
  232. The parenthesis also define substrings of the total matched string that 
  233. can be used either later during substitution. The substring delimited by 
  234. the pair of parenthesis that includes the nth left paren is denoted \n, 
  235. where n is 1, 2, .... 9.  '\0' and '&' both refer to the matched text.
  236.  
  237. EXAMPLE: 
  238. The following regular expression will match either 'aabox' or 'bbbox':
  239.  
  240.               (aa|bb)box
  241.  
  242. In addition, \w matches an alphanumeric character (including "_") 
  243. and \W a nonalphanumeric. Word boundaries may be matched by \b, 
  244. and non-boundaries by \B. A whitespace character is matched by 
  245. \s, non-whitespace by \S. A numeric character is matched by \d, 
  246. non-numeric by \D. You may use \w, \s and \d within character 
  247. classes.
  248.  
  249. The class of character recognized by \w (and hence not recognized 
  250. by \W), can be augmented via the 'addAlphaChars' command.
  251.  
  252. See here for more details.  Regular expressions can be very difficult to 
  253. master, but they the following section shows how useful they can be.
  254.  
  255.  
  256.  
  257.           Searches, Incremental
  258.  
  259. Emacs users will be happy that both forward and backward incremental 
  260. searches are implemented. Incremental searches bypass the normal search 
  261. dialog and search for the current text after each keystroke. The result is 
  262. often much faster and less intrusive. Executing either while an incremental 
  263. search is in progress causes the search to proceed to the next instance of 
  264. the current text. Incremental search mode is exited when any other command 
  265. (executed through the menus or through bindings that include at least one of 
  266. the control key and the option key) is executed, or when the escape or 
  267. delete key is used. Typing control-w while incremental search is active 
  268. causes all the characters to the end of the next word boundary to be 
  269. added to the search.
  270.  
  271.  
  272.           Marks
  273.  
  274. Alpha allows the user to use "marks" to remember positions in files. Marks 
  275. "float". That is, if a mark is initially at position 312 and then five 
  276. characters are inserted at location 297, the mark's new value will be 317. 
  277. Alpha uses three different types of marks. 
  278.  
  279. The first is generically referred to as "the mark". The mark is set to the 
  280. current insertion point by the command 'setMark' (control-space by 
  281. default). This requires that the Emacs feature is active. The position in 
  282. the file indicated by the blinking cursor is referred to as the current 
  283. insertion point. Many commands (such as "cut" and "copy") can operate 
  284. either on the currently selected (hilighted) text, or the text between the 
  285. current insertion point and "the mark". For example, if you move the cursor 
  286. to the beginning of the word "allybaba", hit control-space (the status bar 
  287. should say "Mark set"), move to the end of the word and hit option-w (the 
  288. status bar should say "Region copied"), the effect is the same as if you 
  289. had used the mouse to select the text and then selected the "Copy" command 
  290. from the "Edit" menu.
  291.  
  292. The second type of mark are the permanent marks. Permanent marks are set, 
  293. removed, and moved-to through the three corresponding menu items in the 
  294. "Search" menu. Permanent marks differ from the generic mark in that they 
  295. have names, there can be any number of them, and they are saved in the 
  296. resource fork if the file is subsequently saved.
  297.  
  298. Permanent marks can be accessed via the "Text:Named Marks" menu items, by 
  299. a popup menu called by mousing down on the M icon above a vertical 
  300. scrollbar, or by command-mousing on a window's titlebar.
  301.  
  302. The third type of mark is the temporary mark. Like permanent marks, 
  303. temporary marks can be named and there can be any number of them. Unlike 
  304. permanent marks, temporary marks do not "dirty" the file, and they aren't 
  305. saved. So far, temporary marks are used exclusively to implement higher 
  306. order functions in TCL procedures.
  307.  
  308. At the time a file is saved, the marks for that file are stored into the 
  309. file's resource fork.
  310.  
  311.  
  312.  
  313.  
  314.           Colorizing
  315.  
  316. Alpha supports automatic "colorizing" of text. This is controlled by the 
  317. function 'regModeKeywords', which registers keywords to colorize in a 
  318. specific mode. Colorizing can be turned off via the 'coloring' flag.
  319.  
  320. You can add words to a given mode by opening a mode specific prefs file via 
  321. the "Config:Current Mode:Edit Prefs File" menu item, and using 
  322. regModeKeywords with the -a option.
  323.  
  324. Colors for keywords, strings, and comments (for applicable modes) can all 
  325. be changed via the "Config:Current Mode:Preferences" menu item.
  326.  
  327. C/C++ allows function calls to be colorized.  Alpha will colorize words 
  328. immediately before left parens, assuming that they are function calls. 
  329. Use "Config:Current Mode:Preferences" in C or C++ mode to turn this on.
  330.  
  331. Additionally, Alpha allows the text color and window background to be 
  332. changed. These are changed by redefining 'Foreground' and 'Background' in 
  333. the "Config:Redefine Colors" menu. The menu also allows all eight of the 
  334. primary colors to be redefined as well. For instance, you can redefine 
  335. 'red', and any text that is currently red will then be the new color you 
  336. specify. Finally, there are eight other colors 'Color_9' through 'Color_15' 
  337. that can be used though regModeKeywords etc, and values for these can be 
  338. redefined as well.
  339.  
  340.  
  341.  
  342.           C/C++
  343.  
  344. "C" and "C++" modes are selected either automatically when the file is 
  345. opened, by suffix, or via the mode popup menu on the status bar.  The 
  346. suffixes mapped to any mode can be changed via "Config:Suffix Mappings╔".  
  347. To set up '*.c' and '*.h' to map to C rather than C++, for instance, do the 
  348. following:
  349.     1) open the suffixes dialog via "Config:Suffix Mappings╔"
  350.     2) remove *.c and *.h patterns from C++
  351.     3) and add *.c and *.h to C.
  352. That's it!
  353.  
  354. The rest of Alpha's support for C and C++ falls into four broad categories:
  355.     Ñ "electric" editing
  356.     Ñ colorizing
  357.     Ñ marking
  358.     Ñ interaction with CodeWarrior/Think
  359.  
  360. For electric editing, Alpha's default configuration is set up to perform 
  361. electric functions at left and right curly braces, semi-colons, and 
  362. carriage returns, all of which can be turned off via the 
  363. "Config:Current Mode:Menus And Features╔" dialog. 
  364.  
  365. Alpha's C and C++ modes can be configured with menus for 
  366. CodeWarrior, Symantec, Think Ref, and the Toolbox Assistant. You can prune 
  367. these to the two (or one) menu you want via the "Config:Current 
  368. Mode:Menus And Features╔" menu item.
  369.  
  370. Alpha automatically colorizes key-words, #defines, comments, strings, and 
  371. function calls. All colors can be changed via "Config:Current 
  372. Mode:Preferences", or turned off entirely by selecting the "none" color option.
  373. New key-words can be added by lines of the form:
  374.     regModeKeywords -a -k blue C {newword1 newword2}
  375. See the Colorizing section for more details.    
  376.  
  377. The Mark menu, accessible from the the M icon above the vertical 
  378. scrollbar, allows C/C++ files to be automatically marked with a new mark 
  379. for each function in the file. You can jump to the resulting marks via the same 
  380. menu, command-clicking in the window's titlebar, or the "Text:Named 
  381. Marks:Goto" menu item. You can set up Alpha to automatically mark C/C++ 
  382. files that don't have marks on opening by selecting 'autoMark' from the 
  383. "Config:Current Mode:Preferences" dialog.
  384.  
  385. Finally, Alpha is set up to closely cooperate with both Think and 
  386. Codewarrior. Follow the above links for more info.
  387.  
  388.  
  389.  
  390.  
  391.           File Detritus
  392.  
  393. The primary method of either reading or storing files with Alpha, or any 
  394. other Mac editor, is through the GetFile and PutFile dialogs. However, 
  395. Alpha's dialogs are not exactly like those of other applications. 
  396.  
  397. The GetFile dialog has two additional items: a "Read-only" checkbox and an 
  398. "All Files" checkbox.  The first allows you to open a file as read only.  
  399. Files in the read-only state can not be modified, only read.  A read-only 
  400. file is indicated by a lock icon replacing the grow zone icon.  Read-only 
  401. status can be toggled by command-clicking on the icon. The default action for 
  402. 'space' and 'backspace' when a file is read-only is to page forward 
  403. (closing at the bottom of the file) or backward.
  404.  
  405. The second checkbox, "All Files", allows Alpha to open any file rather 
  406. than just those of type 'TEXT'. The type of a file can be determined by 
  407. using the 'll' alias in the Tcl shell.
  408.  
  409.  
  410. The PutFile dialog is used to prompt the user for a new name under which to 
  411. save the contents of a window. This dialog has been enhanced by two popup 
  412. menus: "State" and "Format". "State" allows you to specify how much 
  413. information should be saved in the resource fork of files that you use. If 
  414. the state is set to "MPW", window position, current selection, tab sizes, 
  415. and font information are saved into the resource fork of your application 
  416. every time you open and close it, *even if you don't modify the file*. 
  417. Alpha still manages to coexist with build or make files because saving this 
  418. information does not change the modification date of the file. If the state 
  419. is set to "Think", neither the window position nor the current selection 
  420. are saved. If state is set to "None", no information is saved. The default 
  421. value for saved state can be changed by setting the Alpha variable 
  422. 'savedState' to "mpw", "think", or "none". Note that if a given file 
  423. already has mpw information in it when the file is open, Alpha will always 
  424. update that information when the file is closed. Note also that "marks" 
  425. are always saved in the resource fork whenever a file is saved, 
  426. regardless of the setting of the 'savedState' variable.
  427.  
  428. The "Format" menus allows the way Alpha terminates lines to be changed. 
  429. The Mac uses a carriage return to mark the end of a line, Unix uses a 
  430. linefeed, and IBM uses both (of course). Alpha can read and write any of 
  431. these formats, and can convert between them just by opening a file, 
  432. choosing "Save As", and changing the selection in this menu. Note that if 
  433. you are going to be sharing files with a Unix or IBM machine, you 
  434. probably don't want anything in your resource fork, so you'd probably 
  435. want to set 'savedState' to 'none'.
  436.  
  437.  
  438.           Menus
  439.  
  440. Alpha's menus are completely reconfigurable. Some of the menu items are 
  441. internal alpha commands, while others are Tcl procs defined in one of the 
  442. files of the "Tcl" subfolder. The following is an explanation of the 
  443. default menus. The explanations of items that are defined as Tcl procs are 
  444. implemented by the Tcl proc specified by "(proc <name>)", and can be found 
  445. in one of the .tcl files. All others are internal functions. Obviously you 
  446. don't have to worry about how the functions are defined if you don't want 
  447. to modify them.
  448.  
  449. Alpha uses Ramon Felciano's Mercury MDEF to display menus. In addition to 
  450. allowing other modifiers to be shown in the menu, this MDEF also allows 
  451. alternates, items that change depending on the state of the modifier keys. 
  452. Alternate items are tagged below by the modifier that must be pressed to 
  453. display it.
  454.  
  455. File
  456.     New                      New file.
  457.     Open╔                   Open file.
  458.     Recent╔    (available if Recent Files Menu feature is active)
  459.                             Menu of recently opened files. These same files
  460.                             can be opened via the 'editFile' (cmd-') proc
  461.                             of the filesets menu.
  462.     Close                   Close file.
  463.     Close All (option)        Close all files.
  464.     Close Float (shift)        Close a palette.
  465.  
  466.     Save                       Save file.
  467.     Save All (option)        Save all files.
  468.     Save Unmodified (control) Save file without changing the modification 
  469.                             date.
  470.     SaveAs╔                   Prompt for name to same file under.
  471.     Save A Copy As╔ (option) Save a copy of the open window.
  472.     Rename To╔ (shift)        Rename file.
  473.     
  474.     Revert                   Revert to last saved version, throw away undo history. 
  475.     Revert To Backup (option) Revert to last backup copy, if any.
  476.         
  477.     Shell                   Start up command-line shell that interprets Tcl 
  478.                             commands. The shell has a few csh-type features, 
  479.                             such as 'ls', 'rm', etc. commands, as well as file 
  480.                             completion with the TAB key. 
  481.     Toolserver Shell (control) See here.
  482.     Calculator (shift)        See here.
  483.     
  484.     Page Setup╔               Set print options.
  485.     Print (submenu available if Printer Choices feature is active)
  486.         Print╔                Print file directly.
  487.         
  488.         Kodex C Pretty Printer        Print through Kodex app.
  489.         Enscriptor Fancy Printer    Print through Enscriptor app.
  490.         Send PS to 'DropÑPS'        Print through 'DropÑPS' app.
  491.         
  492.     Print All╔    (option)    Print all files.
  493.  
  494.     Quit                       Quit Alpha.
  495.  
  496. Edit
  497.     Undo                    Undo. 
  498.     Redo (option)            Redo. 
  499.     Evaluate                Execute either the window or the selection as Tcl 
  500.                             source. 
  501.     Cut                        Cut selection to scrap.
  502.     Copy                    Copy selection to scrap.
  503.     Paste                    Paste from scrap.
  504.     Select All                Select entire file.
  505.     Select Paragraph (option)    Select current paragraph.
  506.     Clear                    Delete selection.
  507.  
  508.     Twiddle                    Exchange characters bracketing the selection point.
  509.     Twiddle Words (option)    Exchange words bracketing the selection point.
  510.  
  511.     Shift Left                Shift selection left one tab.
  512.     Shift Left Space (option)    Shift selection left one space.
  513.     Shift Right                Shift selection right one tab.
  514.     Shift Right Space (option)    Shift selection right one space.
  515.     Balance                    Select text out to the next set of matching braces.
  516.  
  517.     Emacs                    Lots of Emacs key bindings. Available if 
  518.                             Emacs feature is active.
  519.  
  520. Text
  521.     Fill Paragraph            "Fill" paragraph that contains the insertion (proc 
  522.                             fillParagraph).
  523.     Wrap Paragraph (option)    Break lines longer than 'fillColumn' in paragraph 
  524.                             containing insertion pt (proc wrapParagraph).
  525.     Sentence Paragraph (option-shift) - Forces each sentence to start on new 
  526.                             line. 
  527.     Fill Region                "Fill" selection subject to 'leftFillColumn' and 
  528.                             'fillColumn', (proc fillRegion).
  529.     Wrap Region (option)    Break lines longer than 'fillColumn' in selection 
  530.                             (proc wrapRegion).
  531.     Sentence Region (option-shift) - Forces each sentence to start on new 
  532.                             line. 
  533.  
  534.     Line To Paragraph        Convert a line to a paragraph.
  535.     Paragraph to Line (option) Convert a paragraph to single line.
  536.     
  537.     Sort Lines                Sort selected lines (proc sortLines).
  538.     Reverse Sort (option)    Sort selected lines backwards.
  539.     Spellcheck Window        See here.
  540.  
  541.     Zap Invisibles            Delete all chars in file with ASCII code < 32, except 
  542.                             for LF, TAB and CR.
  543.     Tabs To Spaces            Convert tabs to space runs.
  544.     Spaces To Tabs (option) Convert space runs to tabs.
  545.  
  546.     Indent Line                Indent the current line.
  547.     Indent Selection (option) Indent the selection
  548.     
  549.     Upcase Region            Upcase all chars in region.
  550.     Downcase Region    (option) Downcase all chars in region.
  551.     
  552.     Strings
  553.         Insert Prefix            Prepend string 'prefixString' to every line in 
  554.                                 selection (proc insertPrefix).
  555.         Remove Prefix (option)    Remove prefix string from lines in selection 
  556.                                 (proc removePrefix). 
  557.         Insert Suffix            Append string 'suffixString' to every line in 
  558.                                 selection (proc insertSuffix).
  559.         Remove Suffix (option)    Remove suffix string from lines in selection 
  560.                                 (proc removeSuffix). 
  561.         Set Prefix╔                Change prefix string (proc setPrefix).
  562.         Set Suffix╔                Change suffix string (proc setSuffix).
  563.     Comment Line            Comment out line, considering mode.
  564.     Uncomment Line (option)    Un-comment line, considering mode.
  565.     Comment Box                Create a comment box around selected text.
  566.     Uncomment Box (option)    Remove such a comment box.
  567.     Comment Paragraph        Comment out a paragraph.
  568.     Uncomment Paragraph        Uncomment a paragraph.
  569.  
  570.     Goto Func
  571.     Goto File Mark
  572.     Mark Hilite                Select text last manipulated, such as from a paste.
  573.     Named Marks
  574.         Set╔
  575.         Goto╔
  576.         Remove╔
  577.         Sort 
  578.         Sort By Position
  579.     Unnamed Marks
  580.         Set╔
  581.         Exchange Point And Mark
  582.  
  583. Search
  584.     Find╔                    Present a search dialog.
  585.     Search Start (option)    Return selection point to where the last search 
  586.                             started. 
  587.     Find Again                Search forward again with same settings.
  588.     Find Again Backward (option)    Search backward again with same settings.
  589.     Find in Next File        Restart multiple-file search in next file after 
  590.                             stopping at a match.
  591.     Enter Search String        Use the current selection as the search text.
  592.     Enter Replace String (option)    Use the current selection as replace text.
  593.  
  594.     Quick Find                Incremental search forward (grep, match words off, 
  595.                             ignore case on). Type chars to define string, 
  596.                             control-w adds the current word to the search
  597.                             string, control-s/r search for the same string again.
  598.     Quick Find Regexp (option)    Same as Quick Find but lets you use a regular
  599.                             expression.
  600.     Reverse Quick Find        Same think in reverse.
  601.     
  602.     Replace                    Replace the selection.
  603.     Replace and Find Again    Replace the selection and search again forward.
  604.     Replace All                Replace all of occurances of the search string 
  605.                             in the rest of the file.
  606.     Replace in Fileset (control)    Global replace in fileset.
  607.     
  608.     Push Position            Push current pos onto a "stack".
  609.     Pop Position            Pop last pos from stack and go to it.
  610.     Goto Line                Goto specific line number.
  611.     
  612. Utils
  613.     Compare
  614.         Windows                Compare top two windows, sending output to a third. 
  615.                             Selecting a line in the third window and hitting 
  616.                             return (or enter) moves that line to the top of 
  617.                             the window.
  618.         Files                Same as above, but prompts for files.
  619.         Directories            As above, but works for entire directories. 
  620.     File Utils
  621.         File Remove╔        Remove a file.
  622.         File Info╔            Display/edit info about a file.
  623.         Text to Alpha        Set creator a text files to Alpha.
  624.     Win Utils
  625.         Insert Path Name╔    Prompt for a file and insert complete pathname in 
  626.                             window.
  627.         Insert File╔        Insert the text of another file.
  628.         Word Count            Count lines, words, chars in window (proc wordCount).
  629.     Ascii Etc
  630.         Quote Char            Wait for key press and insert key.
  631.         Key Code╔            Wait for key press and insert keycode and modifier 
  632.                             string suitable for key binding.
  633.         Key Ascii╔            Same as above, but use ascii form.
  634.         Get Ascii╔            Display ascii code for char to right of insertion.
  635.         Insert Ascii╔        Prompt for ascii code and insert character.
  636.     Matching Lines            Find all lines that match a regular expression and 
  637.                             summarize in new window. (proc matchingLines). 
  638.     Goto Match                Jump to the original text specified by the current 
  639.                             line in a "Batch Find" or "Matching Lines" window.
  640.     Next Match                Next match.
  641.     Send URL                Send selection as URL to proper internet app.
  642.     Cmd-Double Click        Look up and display definition of the selected 
  643.                             word. If in "C" or "C++" mode, use the file pointed 
  644.                             to by 'tagFile'. If in "Tcl" or "Shel" mode, look
  645.                             in "Alpha Commands", "Tcl Commands", and the "Tcl"
  646.                             subfolder.
  647.                             
  648. Config
  649.     Current Mode            
  650.         Menus and Features╔    Change current mode's menus and features.
  651.         Preferences╔        Change options for current mode.
  652.         Edit Prefs File        Edit mode-specific preferences.  Loaded 
  653.                             after mode entered for the first time.
  654.         Load Prefs File        Load current mode's preferences.
  655.         Describe mode        Describe current mode's variable settings and 
  656.                             bindings.
  657.         Change╔                Change the current mode.
  658.  
  659.     Global
  660.         Menus and Features╔    Change global menus and features.
  661.         Preferences>        Global variables.
  662.         Edit prefs file        Put your own arbitrary startup code here (used to be 
  663.                             "userStartup.tcl"). Loaded after all standard Tcl 
  664.                             code. 
  665.         Special Keys╔
  666.         List Global Bindings Create a new file containing all current global 
  667.                             key bindings.
  668.         List Packages
  669.         List All Bindings    Create a new file containing all current key 
  670.                             bindings.
  671.         List Functions        List all functions currently defined, both
  672.                             "core" functions (those coded in C), and those
  673.                             coded in the supplied Tcl files.
  674.         Rebuild Package Indices
  675.         
  676.     Suffix Mappings╔        Displays and allows editing of suffixes (really
  677.                             filename patterns) for all existing modes. 
  678.     Packages->                Download updated versions of Alpha or any packages
  679.                             from one of Alpha's ftp/www sites.
  680.     Helper Apps╔
  681.     Describe Binding╔        Wait for a keystroke, then display that keystroke's 
  682.                             binding.
  683.     View Saved Settings╔     Any variables or flags that you modify during
  684.                             the course of a session are saved to files in the 
  685.                             system preferences folder when Alpha quits. 
  686.                             This function shows all such saved variables.
  687.     Remove Saved Settings╔    This function allows settings to be removed.
  688.     
  689.  
  690.     Set Font Tabs╔            Change font and/or tabs for current file.
  691.     Redefine Colors->        See Colorizing.
  692.             
  693. Wins (an icon with three windows)
  694.     Zoom                    Zoom windows in and out.
  695.     Single Page (option)    Resize as single page.
  696.     Choose A Window            Choose window to select from list (proc 
  697.                             chooseAWindow).
  698.     Iconify                    Toggle iconification of front window.
  699.     Arrange                    Rearrange open windows.
  700.  
  701.     Split Window            Split window into two panes, or unsplit.
  702.     Toggle Scrollbar        Toggle the horizontal scrollbar on the frontmost 
  703.                             window. The scrollbar can be enabled/disabled on 
  704.                             subsequent variables by changing the value of 
  705.                             the 'horScrollBar' flag.
  706.  
  707.                                 
  708.     
  709.           Menus, User-Defined 
  710.  
  711. All of Alpha's menus are defined in the initialization files that Alpha 
  712. loads on startup.  They can be altered or discarded at well.  Alpha's menu 
  713. commands allow the the user to build custom menus which contain names of 
  714. functions, macros, or arbitrary TCL commands that just HAVE to be in the 
  715. menus, as opposed to being merely callable through the bindings.  The 
  716. syntax is dead simple.  Menus can be nested, allowing hierarchical menus to 
  717. be defined.  See the 'alphaMenus.tcl' file for examples.  The following meta 
  718. characters can be embedded in the strings:
  719.  
  720.    Meta-character     Usage
  721.    --------------     -----
  722.  
  723.     ; or Return       Separates multiple items.
  724.     ^                 Followed by an icon number, adds 
  725.                       that icon to the item.
  726.     !                 Followed by a character, marks the
  727.                       item with that character.
  728.     <                 Followed by B, I, U, O, E, or S,  
  729.                       sets the character style of the item.
  730.     /                 Followed by a character, sets up
  731.                       a keyboard equivalent.
  732.     (                 Disables the item.
  733.  
  734.  
  735. The following modifiers can be used to require other combinations of modifiers
  736. than just the command key. Control-option, for instance, is specified by 
  737. putting the string "<B<I" in the menu item. The menu symbol for shift is 
  738. an upward outline arrow, control is the outlined ^ symbol ("Wins:Iconify"
  739. has one), and option is the wavy line with the dot in the upper right 
  740. ("File:Close All" has one). The following are characters that can follow 
  741. the '<' and what they signify.
  742.  
  743.     B        - control key required
  744.     I        - option key required
  745.     U        - shift key required (only for alpha-numerics!)
  746.     O        - command key required
  747.     S        - isDynamicItem is part of dynamic item.
  748.     E        - forces item to start new dynamic item.
  749.  
  750.  
  751. A '/' followed by a character in the left column sets up a keyboard 
  752. equivalent for the key in the right column:
  753.  
  754.     a    Enter            n    F10
  755.     b    Return            o    F11
  756.     c    Tab                p    F12    
  757.     d    Num Lock        q    F13
  758.     e    F1                r    F14
  759.     f    F2                s    F15
  760.     g    F3                t    Help
  761.     h    F4                u    Del
  762.     i    F5                v    Forward Del
  763.     j    F6                w    Home
  764.     k    F7                x    End
  765.     l    F8                y    Page Up
  766.     m    F9                z    Page Down
  767.     
  768.  
  769. The menu creation syntax is :
  770.  
  771.     Menu [-s] <-n name> <-i num> [-p procName] [-m] [-M <mode>] "Tcl list of items"
  772.  
  773. Where the arguments have the followings meanings:
  774.   '-s'            Use system menu definition proc (faster).
  775.   '-i <num>'    Resource id of icon suite to use for menu title.
  776.   '-n <name>'    Name of menu.
  777.   '-m'            No menu form. If not supplied, each menu item is split into 
  778.                   words at each capitalized letter.
  779.   '-p <pname>'     Rather that having alpha call a Tcl proc named by the menu 
  780.                   item's text, this option tells Alpha to call the tcl proc 
  781.                   named by 'pname' with two arguments: the menu name, and the
  782.                   text of the menu item chosen.
  783.   '-M <mode>'    Bindings only take effect in specified mode.
  784.   
  785. Once the menus are created, they can be inserted and  deleted from the 
  786. menu bar by the syntax:
  787.  
  788.    insertMenu "name"
  789.    removeMenu "name"
  790.  
  791. as well as through macros.
  792.  
  793.  
  794. As alluded to above, Alpha attempts to make procedure names readable in the 
  795. menus by separating words at any capitalized letter. For example, 
  796. 'findFile' becomes "Find File". This function is turned off by the '-m' 
  797. option. 
  798.  
  799. Menu items can be enabled and disabled through the TCL command 
  800. 'enableMenuItem'. Menu items checkmarks can be turned on and off via 
  801. 'markMenuItem'. Menu items can be appended via 'addMenuItem' and deleted 
  802. via 'deleteMenuItem'. See the "Alpha Commands" help file for syntax. 
  803.  
  804. As explained above, the Mac ToolBox uses various keys to specify text 
  805. style and key equivalents. Sometimes you may want these characters 
  806. included in your text literally. If an ampersand ('&') is the last 
  807. character in a menu item, Alpha coerces the string so that these special 
  808. characters are not interpreted.
  809.  
  810. If an ellipsis ('╔') is the last character in a menu item (except possible 
  811. for the above ampersand), it is stripped off before searching for the 
  812. function corresponding to the chosen item.
  813.  
  814.  
  815. #================================================================================
  816. # Just for the heck of it, the following is a script that I put in my 
  817. # prefs.tcl file. It creates a menu for all the .tex files in my 
  818. # thesis folder, minus the dirname and .tex extension.
  819. #
  820. set THESIS "Internal:Textures:thesis"
  821. proc thesisMenuProc {menu item} {
  822.     global THESIS
  823.     edit -r -m $THESIS:$item.tex
  824. }
  825.  
  826. set files ""
  827. foreach f [glob $THESIS:*.tex] {
  828.     lappend files [file rootname [file tail $f]]
  829. }
  830. menu -n Thesis -m -p thesisMenuProc $files
  831. unset files
  832. #================================================================================
  833.  
  834.  
  835.  
  836.           TCL
  837.  
  838. See the Tcl manual page under the 'Help' menu for a complete description of 
  839. Tcl, the Tcl shell, and its commands.  Each of the Tcl commands and 
  840. several sections have a mark defined, so you can use the "Mark" menu to 
  841. navigate through the manual page.  
  842.  
  843.  
  844.  
  845.           Key Bindings
  846.  
  847. Any TCL command can be bound to any single keystroke. One way to bind a 
  848. function is with a statement such as:
  849.   
  850.       Bind 'c' <modifier string> funcName [<mode>]
  851.           
  852. where c is a character, <modifier string> is an optional string containing 
  853. one or more of:
  854.  
  855.       c   - command modifier
  856.       o   - option modifier
  857.       s   - shift modifier
  858.       z   - control modifier
  859.       e   - escape modifier      
  860.  
  861. Additionally, the modifier string can contain a capital letter specifying 
  862. that the binding is only activated if preceded by control and the lowercase 
  863. version of that letter. This feature allows multiple-key combinations ala 
  864. Emacs. The following line binds cmd-shift-f to the function 'forwardChar': 
  865.  
  866.  Bind 'f' <cs> forwardChar 
  867.  
  868. The next line would bind the same function to C-x C-f, assuming that 
  869. control-x is bound to the function 'prefixChar': 
  870.  
  871.  Bind 'f' <cX> forwardChar 
  872.  
  873. 'mode' is an optional parameter that specifies, when present, that the 
  874. binding is only active in a given mode. Note that given a general binding 
  875. (no mode specification) and a binding specific to the current mode, the 
  876. last binding to have been created is the one found first.
  877.  
  878. Additionally, most keyboards have keypads and/or Function Keys. These 
  879. keys can be bound using case-insensitive numeric labels using the same 
  880. bind command as above, with the label replacing the character. For 
  881. example, to bind F1 to function 'funcName', the following would work:
  882.  
  883.     Bind F1 funcName
  884.  
  885. As above, the binding can include a modifier string. The following labels 
  886. are defined for US keyboards:
  887.  
  888.   Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 Help Home Pgup Del 
  889.   End Pgdn Left Right Up Down Clear Kpad0 Kpad1 Kpad2 Kpad3 Kpad4 Kpad5
  890.   Kpad6 Kpad7 Kpad8 Kpad9 Kpad= Kpad/ Kpad* Kpad- Kpad+ Enter Kpad.
  891.  
  892. The menu item 'Config:Global:List All Bindings' will list all of the 
  893. bindings currently in effect in a format suitable for re-loading.
  894.  
  895. The above labels may not be sufficient for all keyboards (attention 
  896. international users). If a hex number is used instead of a character inside 
  897. the single quotes, the binding is done to key codes instead of ascii 
  898. values. The following is a key code version of the same binding: 
  899.  
  900.       Bind 0x03 <cs> forwardChar
  901.  
  902. The key code for any given key can be obtained by using the menu item 
  903. 'Utils:Ascii Etc:Key Code'.
  904.  
  905. Also, there is an alternate form that allows the specification of an 
  906. ascii code directly:
  907.  
  908.     ascii 0x20 <z> setMark
  909.     
  910. Binds control-space to 'setMark'.
  911.  
  912. Note that menu item command equivalents take precedence over bindings, and 
  913. that the 'Bind' command does not affect the command equivalents displayed 
  914. in the menus. Also note that key code bindings take precedence over ascii 
  915. bindings.
  916.  
  917. Finally, there are 'unBind' and 'unascii' functions, with identical 
  918. arguments to their counterparts. 
  919.  
  920.  
  921.  
  922.           Undo + Redo
  923.  
  924. Alpha supports unlimited undo and redo. This means that most changes can 
  925. be undone, and then redone, at will. Bear in mind that once you create new 
  926. modifications, all changes that you have undone but not redone are lost. 
  927. Another point to bear in mind is that saving a buffer to disk currently 
  928. flushes the undo buffer. 
  929.  
  930.  
  931.           Event Hooks
  932.  
  933. Alpha calls the TCL procs "openHook", "saveHook", "saveasHook", 
  934. "savePostHook", "closeHook", "activateHook", "deactivateHook", 
  935. "suspendHook", "dirtyHook", "quitHook" and "resumeHook" when the 
  936. corresponding events occur. With the exception of "saveasHook", the proc 
  937. are all called with the complete pathname as the sole argument. 
  938. "saveasHook" is called with the old pathname as the first argument and the 
  939. new pathname as the second argument. Default implementations for these 
  940. commands are in the file 'alphaHooks.tcl'. 
  941.  
  942. You can add to these hooks by registering procs to be called when the 
  943. hooks are called. This is done by adding a line like this to your prefs 
  944. file:
  945.   
  946.       hook::register 'hook-name' 'your proc' 'mode' ?... 'mode'?
  947.  
  948. Here are three examples:
  949.   
  950.       hook::register savePostHook codeWarrior_modified "C++" "C"
  951.       hook::register savePostHook ftpPostHook
  952.     hook::register saveasHook htmlLastModified HTML
  953.  
  954. If you don't include a 'mode', then your proc will be called no
  955. matter what the current mode is.   Avoid this unless absolutely
  956. necessary.  
  957.  
  958.  
  959.           Tags
  960.  
  961. Alpha supports the use of tags to find declarations of functions; by 
  962. default this is set up only for 'C'.  When searching for a tag, Alpha looks 
  963. for the tag file specified by the "tagFile" string variable.  Alpha's tag 
  964. generating routines use the regular expression in the string variable 
  965. "funcExpr" to look for function declarations.  In other words, we don't 
  966. parse the text.  If you declare your functions differently, you can change 
  967. "funcExpr" to suit your own style.  Alpha currently uses the following 
  968. regular expression to find C function declarations:
  969.  
  970.               ^[^ \t\(#\r/@].*\(.*\)$
  971.  
  972. Although complicated, this expression makes sense if you slowly wade 
  973. through it. The string that we are looking for must take up an entire 
  974. line. It must begin with a character other than '\t', '#', '\r', '/', ' ', 
  975. '(', or '@'. There must be a set of parenthesis.   
  976.  
  977. Note that not only can you customize this to your style of 'C' 
  978. declarations, you could also use it to generate tags for other languages. 
  979. The only thing you need to bear in mind is that the tag routines use the 
  980. complete word previous to the first '(' in the selected line as the 
  981. function's name. If there is no '(' in the selected line, the last word in 
  982. the line is used. Therefore, Pascal procedures with or without parameters can be 
  983. identified.
  984.  
  985. Caveat: Apple's list manager can't handle more than 32k of text in the 
  986. entire list, so there is a practical limit of 2000 or so tags in your 
  987. project.
  988.  
  989.  
  990.           Backups
  991.  
  992. If the 'backup' variable is set in the "Config:Global:Preferences:Backups" 
  993. dialog, Alpha backs up each file before saving new modifications. By 
  994. default, the backup file is in the same folder, and its name is formed by 
  995. suffixing a tilde to the name of the saved file. Backups are actually 
  996. performed in the 'saveHook' proc (see above), in the file alphaHooks.tcl. The 
  997. Tcl variables 'backupFolder' and 'backupExtension' can be used to modify this 
  998. behavior.
  999.  
  1000.  
  1001.           Fill Routines
  1002.  
  1003. The "fill" and "wrap" routines reformat text to specified line lengths. 
  1004. This is useful in two case. First, word processors such as Microsoft Word 
  1005. only insert carriage returns at the end of paragraphs. Secondly, while 
  1006. typing and inserting text into pre-existing paragraphs, the line lengths 
  1007. become unequal. 
  1008.  
  1009. The "wrap" routine handles word processor documents quickly by merely 
  1010. inserting carriage returns as necessary to ensure all lines in the 
  1011. selected region are shorter than specified by the variable 'fillColumn'. 
  1012. Alpha asks the user if wrapping should be done whenever the user opens 
  1013. files that have lines longer than 'paraColumn' characters. This feature 
  1014. can be defeated by including the word 'nowrap' anywhere on the first line.
  1015.  
  1016. The TCL routines 'fillRegion' and 'fillParagraph' go further. Not only do 
  1017. they break lines, but they also coalesce lines to eliminate short lines. 
  1018. Both routines work by stripping the relevent text of white space, then 
  1019. re-inserting white space and carriage returns so that no line extends past 
  1020. 'fillColumn' characters in length and begins with 'leftFillColumn' spaces 
  1021. characters. Both routines are implemented in the file 'textFill.tcl', and 
  1022. therefore different definitions of paragraphs can be accomodated by 
  1023. modifying the appropriate TCL procedures.
  1024.  
  1025.  
  1026.           Soft Text Wrapping
  1027.           
  1028. "Soft" text wrapping is re-formatting the rest of the paragraph on-the-fly 
  1029. as text is inserted and deleted. Soft-wrapping is enabled by selecting 
  1030. "Soft" in the wrap popup menu in the status bar. The text to be wrapped is 
  1031. delimited by the current line and the last line in the current paragraph. 
  1032. Wrapping occurs after insertions that result in the current line becoming 
  1033. longer than 'wrapHigh' characters long (tabs counted as one character), or 
  1034. deletions where the length of the line (tabs likewise) becomes less than 
  1035. 'wrapLow' characters long.
  1036.  
  1037.  
  1038.           Word Breaking
  1039.  
  1040. Alpha allows you to redefine its internal notion of what a word is, 
  1041. through the variables 'wordBreak', and 'wordBreakPreface'. 'wordBreak' is 
  1042. set to a regular expression that defines a word to you. 'wordBreakPreface' 
  1043. should be a regular expression that matches exactly one of any characters 
  1044. that are not in your word definition. 
  1045.  
  1046. For instance, the default definition of 'wordBreak' is '\w+'. This matches 
  1047. any contiguous sequence of contiguous alphanumeric characters.
  1048.  
  1049. The default value for wordBreakPreface is '(\W)', basically just 
  1050. the negation of any any of the characters in your 'wordBreak' definition. 
  1051.  
  1052. The need for both these variables in backward searches can be seen as 
  1053. follows. Suppose your window's text is "hey hello", and the current 
  1054. insertion is between the two 'l's. Now, searching backwards for the above 
  1055. 'wordBreak' definition will take the insertion to between the 'e' and the 
  1056. first 'l', not really where we want to say is the start of the word. By 
  1057. contrast, if we search backwards for 'wordBreak' and 'wordBreakPreface' 
  1058. concatenated together, and then move forward one character after a 
  1059. successful search, we end up right before the 'h' in 'hello', just where 
  1060. we want to be.
  1061.  
  1062.  
  1063.           File Sets
  1064.  
  1065. File Sets are lists of files that Alpha uses for multiple-file searches and 
  1066. tag searches, among other things.  Typically, a user will set up several 
  1067. different file sets, perhaps one specifying all the source files in a 
  1068. project, another specifying all the Mac include files, and another 
  1069. specifying all the UNIX include files.  When a command using file sets is 
  1070. initiated, Alpha evaluates the command "getCurrFileSet", which returns a 
  1071. list of complete pathnames to search.
  1072.  
  1073. Functions that use file sets operate on the "current" fileset, which is 
  1074. specified by the 'currFileSet' variable.  The current file set can also be 
  1075. switched by using the "File Set" hierarchical menu.  There is also a flag 
  1076. 'Auto Adjust Fileset' which will switch filesets whenever the fileset menu 
  1077. is used to open a file.
  1078.  
  1079. Selecting any item from the fileset menu opens that file.  If the flag 
  1080. 'Include Non Text Files' is set, the fileset menu may contain files Alpha 
  1081. is not designed to open; these are sent to the Finder which will open them 
  1082. using whichever application created them.  A common use of this feature is 
  1083. a hierarchical fileset containing a complete C or C++ project.  Selecting any 
  1084. project source file will open that file for editing, and selecting the 
  1085. project file/debugging symbol file/... will open that using appropriate 
  1086. tool (Symantec Project Manager or Codewarrior IDE or Debugger,╔)
  1087.  
  1088. AlphaLite has no fileset utilities menu, allowing just for the creation and 
  1089. deletion of filesets.
  1090.  
  1091. Fileset Utilities
  1092. =================
  1093.  
  1094. The fileset utilities menu contains the following items:
  1095.  
  1096. New Fileset╔          -- create a new fileset of one of the following 
  1097.                         six standard types (others may be added by
  1098.                         writing your own Tcl code. see "filesetsMenu.tcl"
  1099.                         and "latexFilesets.tcl" for details):
  1100.                             Codewarrior 
  1101.                             FromDirectory 
  1102.                             FromHierarchy 
  1103.                             FromOpenWindows 
  1104.                             Ftp
  1105.                             Procedural
  1106.                             Tex 
  1107.                             Think 
  1108.  
  1109. Delete Fileset╔      -- remove a fileset, permanently if desired.
  1110. Update Current Fileset -- re-build a fileset from scratch
  1111. Update A Fileset     -- (hold down option) lets you choose a fileset to 
  1112.                         rebuild.
  1113. Rebuild All Filesets -- total menu rebuild.
  1114. Zap And Build Filesets -- (hold down option) a more drastic version of the above
  1115. Choose                  -- a hierarchical menu from which to set the 
  1116.                         current fileset.
  1117. Hide Fileset          -- if you have many filesets, some of which are only 
  1118.                         used for searching purposes, you can remove them 
  1119.                         from the menu.
  1120. Fileset Flags         -- See below for an explantion of the flags.    
  1121.  
  1122. Find Tag              -- see 'Tags' for information on this and the 
  1123.                         following item.
  1124. Create Tag File 
  1125.  
  1126.  
  1127. Browse Fileset╔      -- opens a window containing all fileset items, 
  1128.                         from which any can be opened.
  1129. Close Entire Fileset╔ -- close all windows which belong to a given fileset.
  1130. Fileset To Alpha╔     -- convert all text files in a fileset to Alpha's creator.
  1131. Open Entire Fileset╔ -- open all files in a fileset
  1132. Open Fileset Folder╔ -- tells the Finder to open the base folder which 
  1133.                         contains a fileset.
  1134. Rename Fileset╔      -- change a fileset's name
  1135. Replace In Fileset╔  -- global search and replace in all files. Use this 
  1136.                         item with care!
  1137. Stuff Fileset╔           -- If you have 'DropStuff' installed, you can archive a 
  1138.                         fileset.
  1139. Word Count              -- Count all words in a fileset 
  1140. Word Count Fast         -- A quicker version which seems to have a memory leak!
  1141.  
  1142. The following flags may be set:
  1143.  
  1144. Auto Adjust Fileset      -- opening a file from the menu will adjust 'currFileSet'
  1145. Include Non Text Files     -- files not of type 'TEXT' may be in the menu.
  1146. Indent Fileset Items     -- visually format submenus if appropriate.
  1147. Sort Fileset Items       -- force alphabetical ordering for all filesets
  1148. Sort Filesets By Type      -- structure the fileset menu in a user-defined, type-
  1149.                         dependent fashion; see Personalisation.
  1150.  
  1151. Fileset Types
  1152. =============
  1153.  
  1154. 'From Directory'     -- The basic type: create a fileset of all files in a
  1155.                         given directory which match a given pattern.
  1156.                         
  1157. 'From Hierarchy'     -- Takes the above one step further and allows filesets
  1158.                         to include all files in a nested set of folders.
  1159.                         
  1160. 'From Open Windows'  -- Make a fileset containing all currently open windows.
  1161.  
  1162. 'Codewarrior'         -- Query the Codewarrior IDE for a list of all files in
  1163.                         the current project.
  1164.                         
  1165. 'Think'                 -- Query the Symantec Project Manager for a list of all
  1166.                         files in the current project.
  1167.  
  1168. 'Tex'                 -- Make a fileset of all parts of a multi-part TeX/LaTeX
  1169.                         document.  Alpha's LaTeX mode understands these and
  1170.                         will automatically send your TeX application the base
  1171.                         .tex/.ltx file when you select 'Typeset' on any 
  1172.                         component part.
  1173.  
  1174. 'Ftp'                 -- documentation missing╔
  1175.  
  1176. 'Procedural'         -- documentation missing╔
  1177.  
  1178. The following items will be added to the utilities menu if you use 
  1179. TeX filesets:
  1180.  
  1181. ExtractEpsBoxSizes   -- search all document parts for included eps graphics,  
  1182.                         extract bounding box information from the .eps files 
  1183.                         and insert it explicitly into the document (can lead 
  1184.                         to much quicker typesetting).
  1185. DeleteEpsBoxSizes    -- remove all the above bounding box information
  1186. HierarchicalBibFiles -- bibliography files may \input others, so they should
  1187.                         be searched (the default is not to do this, because
  1188.                         .bib files may be enormous).
  1189.  
  1190. Personalisation
  1191. ===============
  1192.  
  1193. As well as adjusting the aforementioned flags, the fileset menu allows 
  1194. complete user control of the structure of the menu in the following way: 
  1195. Set the 'Sort Filesets By Type' flag, and set the variable 
  1196. "filesetSortOrder" as follows:
  1197.  
  1198.    The structure of    this variable dictates how the fileset
  1199.    menu    is structured:
  1200.        
  1201.        '{pattern p}' 
  1202.            lists all filesets which    match 'p'
  1203.        '-' 
  1204.            adds    a separator    line
  1205.        '{list of types}' 
  1206.            lists all filesets of those types.
  1207.        '{submenu name sub-order-list}' 
  1208.            adds    a submenu with name    'name' and recursively
  1209.            adds    filesets to    that submenu as    given by the 
  1210.            sub-order.
  1211.            
  1212.    Leading,    trailing and double    separators are automatically
  1213.    removed.
  1214.  
  1215. For example, the default value of this variable (more as an example than 
  1216. anything else) is:
  1217.  
  1218. set filesetSortOrder { {pattern System} {pattern User} {pattern Preferences} \
  1219.                         - {tex} - {pattern *.cc} \
  1220.                         {submenu Headers {pattern *.h}} \
  1221.                         - {fromDirectory think codewarrior \
  1222.                         fromOpenWindows fromHierarchy} * } 
  1223.  
  1224. You can and should over-ride this in your "prefs.tcl" file (copy and paste 
  1225. from here, then make your changes).
  1226.  
  1227.  
  1228.           Macros, Keyboard
  1229.  
  1230. If you activate the Macros feature Alpha supports keyboard macros which 
  1231. record a sequence of keystrokes to be played back later with the function 
  1232. 'Execute Keyboard Macro' or written into a buffer by selecting 'Dump Macro'. 
  1233. The dump function prompts you for a macro name, which must consist only of 
  1234. letters of the alphabet, digits, and '_'.
  1235.  
  1236. These macro declarations can then be edited, loaded, and bound to 
  1237. keystrokes.  Loading a macro or a binding is accomplished by hiliting the 
  1238. text and selecting the "Evaluate" item of the 'Edit' menu.  If no text is 
  1239. hilited, the entire window is loaded by the same command.  Macros can be 
  1240. bound to keys in exactly the same manner as functions (see above).
  1241.  
  1242.  
  1243.           THINK and Alpha
  1244.  
  1245. Yes! Finally Think has support for external editors (7.0 or better).  To 
  1246. make this work, put an alias of Alpha in the "Tools" subfolder of the 
  1247. folder the project manager is in, and name the alias "Editor".  
  1248. Secondly, check the "Use External Editor" button in the project manager's 
  1249. option dialog.  You do not have to check the "Always Check File Dates" 
  1250. button.
  1251.  
  1252. Any open window events will now be vectored to Alpha, and from within 
  1253. Alpha you can initiate compiles, disassembles, makes, etc. Errors are 
  1254. reported back to Alpha.
  1255.  
  1256. Look in :Tcl:Menus:"thinkMenu.tcl" for the code controlling much of the 
  1257. interactions between THINK and Alpha.  If you improve anything, please send 
  1258. it back to me.
  1259.  
  1260. If a window contains a file that is part of the a project that is 
  1261. currently open in the Think Project Manager, selecting "Open Header" from 
  1262. the Think menu will put up a list of include files. The same files can be 
  1263. accessed by option-clicking on the window's title-bar.
  1264.  
  1265. A fileset consisting of the source to a think project can be created 
  1266. through the "File Sets" menu.
  1267.  
  1268.  
  1269.           Rectangular Editing
  1270.  
  1271. If the option key is pressed while the mouse is dragged,  a rectangular 
  1272. section of text is selected instead of the normal selection. This 
  1273. rectangular selection may extend over multiple lines, but contains only 
  1274. text between the column of the drag start and the column of the drag end. 
  1275. The drag cannot end on a column or row less than the start. This selection 
  1276. can be extended by option-shift-mouse, but not dragged further.
  1277.  
  1278. The rectangular selection can be deleted, copied, and pasted. This is very 
  1279. useful for tables and arrays, such as in LaTeX. Usually, the operation 
  1280. will be intuitive. However, if you use proportional fonts the selection 
  1281. may appear ragged. If some of the line contain tabs, the result may not be 
  1282. want you want. Converting tabs to spaces in the desired region before 
  1283. attempting rectangular selection usually fixes the problems. 
  1284.  
  1285. The most natural semantics of rectangular selection aren't obvious. I 
  1286. chose to implement it in a similar fashion to that of Microsoft Word. 
  1287. Preditor does it in another way, and has many bugs (and it's  commercial, 
  1288. hah!).
  1289.  
  1290.  
  1291.  
  1292.           System Software 7.0
  1293.  
  1294. Alpha is 32-bit clean and high-level event aware. 
  1295.  
  1296. Under 7.0, Alpha uses temporary memory to accommodate large files. This 
  1297. allows you to open multi-megabyte files even when Alpha's partition is set 
  1298. only at 512k, if the system has that much memory available. Note that 
  1299. using temporary memory makes that much memory unavailable to other 
  1300. applications. Contrary to all admonishments, Alpha does not unlock 
  1301. temporary memory across WaitNextEvent calls and may eventually use all the 
  1302. memory in your system. You can turn this feature off through 'tempMem'.
  1303.  
  1304. Note, however, that the clipboard is allocated by the system in Alpha's 
  1305. heap, and therefore cannot take advantage of temporary memory.
  1306.  
  1307.  
  1308.  
  1309.  
  1310.           Apple Events
  1311.  
  1312. See the Help file on AppleEvents.
  1313.  
  1314.  
  1315.           MPW
  1316.  
  1317. Alpha's 'dosc' capability (see the function "dosc") can be used to send 
  1318. events to MPW's ToolServer. Using about ten lines of C code and the ~40 
  1319. lines of Tcl code in 'mpw.tcl', I created a pseudo mpw shell (look under 
  1320. the "File" menu). This shell uses Alpha's 'dosc' function to package each 
  1321. shell command up into an Apple Event and send it to the ToolServer, which 
  1322. then evaluates the command and returns the result to be displayed in the 
  1323. shell. I'm rather new to Apple Events and the ToolServer, so there are 
  1324. probably a few rough edges. 
  1325.  
  1326. If anyone has extensive docs for ToolServer I'd appreciate looking at them. 
  1327. I only have the application because I am a beta tester for another product 
  1328. that supports ToolServer. I was given the application for the beta testing, 
  1329. but not any docs. And of course, I can *not* give away copies of 
  1330. ToolServer because it is a licensed Apple product.
  1331.  
  1332. Finally, Tom Moertel (thor@vivaldi.psu.edu) has written and provided a set 
  1333. of tools that make life easier while writing code in Alpha for the MPW 
  1334. environment. The tools make extensive use of Apple Events, so you must be 
  1335. using MPW 3.3a or greater. (Earlier versions cannot receive commands via 
  1336. Apple Events.) 
  1337.  
  1338.   With the MPW-Alpha package you can:
  1339.   
  1340.     o  Send TCL commands to Alpha from MPW
  1341.     o  Use MPW 411 from Alpha for instant access to programming help
  1342.     o  Automagically locate source code errors from your last MPW compile
  1343.     o  Use the MPW CDent tool to reformat (grind) C/C++ source code
  1344.        from within Alpha
  1345.  
  1346. This package is available via anonymous ftp from cs.umd.edu.
  1347.  
  1348.  
  1349.           File Formats
  1350.  
  1351. Alpha reads and writes files stored in three (or maybe four) different 
  1352. formats. The three main formats are mac (lines end with a carriage 
  1353. return), unix (lines end with linefeed), and IBM pc (lines end with both 
  1354. carriage return and linefeed. Typical, isn't it?).
  1355.  
  1356. Alpha will transparently read and write all three of these formats. You 
  1357. don't have to do anything special to use different formats, but the 
  1358. 'SaveAs...' dialog allows you to specify the format that a file is written 
  1359. in through the 'Format' button.
  1360.  
  1361. The fourth file format is just a modification of the ordinary mac format. 
  1362. Word processors such as Microsoft Word and MacWrite only put carriage 
  1363. returns at the end of paragraphs, so that they can wrap  the paragraphs on 
  1364. the fly. This is what is referred to as 'paragraph format' in the rest of 
  1365. the help text. Alpha does not transparently convert to and from this 
  1366. format because there are valid reasons why someone might want to edit a 
  1367. paragraph formatted file while not in paragraph mode. 
  1368.  
  1369. Therefore, when Alpha detects reads a paragraph-mode file, it asks the 
  1370. user whether or not to remap it. Files can be mapped back to paragraph 
  1371. mode by setting 'fillColumn' to a very large number and executing 
  1372. 'fillRegion' on the text.
  1373.  
  1374.           Printing
  1375.  
  1376. If you activate the "Printer Choices Menu" feature Alpha has many printing 
  1377. options available. Printing is accomplished via a submenu under the File 
  1378. menu. The menus allows printing either via Alpha or several other 
  1379. applications.
  1380.  
  1381. If printing through alpha, the variables 'printHeader', 'printHeaderTime', 
  1382. and 'printHeaderFullPath' control whether and what type of header is 
  1383. printed at the top of each page. These flags are actually used in the procs 
  1384. 'printLeftHeader' and 'printRightHeader' (in clickUtils.tcl) to create the 
  1385. string that appears on the left side of the top of the page. 'leftMargin', 
  1386. 'topMargin', and 'bottomMargin' control margins on the printed page.
  1387.  
  1388. 'printerFont' and 'printerFontSize' allows the size and type of the 
  1389. printed font to be specified.
  1390.  
  1391. The external apps that Alpha is currently configured to use are 
  1392. "Enscriptor", an app that allows multi-column and other options, "Kodex", 
  1393. a "C" pretty printer, and "DropÑPS", which prints postscript files. All 
  1394. options operate on the frontmost window. These applications are not 
  1395. supplied with Alpha, but can be downloaded from any comprehensive mac site. 
  1396. They can also be downloaded from Alpha's home site. "Enscriptor" and 
  1397. "Kodex" are shareware apps written by John Cho. "DropÑPS" is a freeware 
  1398. app written by some evil commercial text editor guru :-).
  1399.  
  1400.  
  1401.           Random Tips
  1402.  
  1403. - When a window is "dirty" (has unsaved changes), a
  1404.   red disk icon appears just below the titlebar in the
  1405.   upper right corner of the window, and a diamond 
  1406.   appears next to the corresponding item in the Windows
  1407.   menu. 
  1408.  
  1409. - All dialogs that have editable text can use the Cut, 
  1410.   Copy, and Paste menu command equivalents.
  1411.  
  1412. - In all dialogs, non-editable controls can be selected 
  1413.   by typing Command-<first char of control>. If there 
  1414.   are no editable controls in the dialog, simply typing 
  1415.   the first letter of the desired control suffices. PgUp,
  1416.   PgDown, Home, and End keys now work for most list dialogs.
  1417.   Popup menus can be navigated with the up and down arrows.
  1418.  
  1419. - Set the flag 'undoOn' to 0 in order to speed up long 
  1420.   replace-all and macro modifications.
  1421.  
  1422. - After a piece of text has been yank'd or paste'd, the 
  1423.   'mark' is set to the beginning of the new text and the
  1424.   selection is at the end. 'markHilite' will now hilite 
  1425.   the entire insertion. This is especially useful when
  1426.   moving code. Cut the code, insert at a new position,
  1427.   select the inserted text by selecting "Text:Mark Hilite", and 
  1428.   then use "Edit:Shift Left" and "Edit:Shift Right" to move
  1429.   the text to the proper indentation.
  1430.  
  1431. - Most help files have marks in them, which let you quickly
  1432.   navigate to places of interest. You can access these marks
  1433.   by command-clicking on the title-bar or on the "M" icon
  1434.   above the vertical scrollbar.
  1435.  
  1436.  
  1437.  
  1438.           Variables 
  1439.  
  1440. There are two different kinds of variables in the Alpha world: global vars 
  1441. and mode vars. Mode vars can have different values in each mode, and are 
  1442. modified by the "Config:Current Mode:Preferences" dialog. Changing one of 
  1443. these variables changes the variable's value for all windows of the current 
  1444. mode.
  1445.  
  1446. Global variables are accessed via the "Config:Global:Preferences" dialog. 
  1447. Changing one of these variables affects all windows.
  1448.  
  1449. Alpha records which variables are modified in the course of a session and 
  1450. saves them prior to quitting.
  1451.  
  1452. This list is incomplete. Click Help in the prefs dialog for more help.
  1453.  
  1454. Mode Vars
  1455.  
  1456. autoMark       Ñ Automatically mark windows on open if they don't have marks.
  1457. fillColumn     Ñ Number of columns use as limit for
  1458.                  "fill" routines. See 'leftFillColumn'
  1459. funcExpr       Ñ Set to the regular expression that 
  1460.                  Alpha uses to find function 
  1461.                  declarations.
  1462. leftFillColumn Ñ Number of blanks left at beginning of 
  1463.                  lines by 'fill' routines. 
  1464. parseExpr      Ñ Set to the regular expression used by parseFuncsAlpha to 
  1465.                  extract the name of a function from the text returned by a
  1466.                  search for funcExpr.
  1467. wordBreak       Ñ Regular expression used to defines words for all internal 
  1468.                  operations. 
  1469. wordBreakPreface Ñ Prepended to 'wordBreak' when looking backwards for a 
  1470.                  word. See the "Word Break" section of this file for more 
  1471.                  information.
  1472. wordWrap       Ñ if true, lines exceeding 'fillColumn'
  1473.                  in length are automatically wrapped
  1474.                  during normal text insertion (typing)
  1475. wrapBreak       Ñ Reg expr used for automatic word wrapping.
  1476. wrapBreakPreface Ñ Reg expr used for automatic word wrapping.
  1477.  
  1478. Global Vars
  1479.  
  1480. autoHScroll       Ñ Automatically scroll horizontal scrollbar
  1481.                  to follow insertion.
  1482. autoSave       Ñ If TRUE, buffers (except untitled buffers) are automatically
  1483.                  saved every 'changesLim' changes.
  1484. backDir           Ñ folder in which to store backup files.
  1485. backExtension  Ñ Suffix to append to backup files.
  1486. backup         Ñ if TRUE, the default Tcl proc 'saveHook' makes a backup 
  1487.                  of a file before the data is written. The default backup
  1488.                  scheme has extension "~".
  1489. blinkCursor    Ñ Cursor blinks
  1490. blockCursor    Ñ if true, Alpha uses a block cursor instead of a vertical 
  1491.                  line. 
  1492. bottomMargin   Ñ Bottom print margin.
  1493. changesLim     Ñ number of changes to a window before 
  1494.                  garbage collection or autosave is done.
  1495. coloring       Ñ enable keyword coloring.
  1496. def{Height,Left,Top,Width} Ñ If 'fullScreen' set, default size
  1497.                  of windows.
  1498. defaultFont    Ñ font to use on new windows and files 
  1499.                  which don't have associated font 
  1500.                  specification resources.
  1501. doubleSpaces   Ñ If true, fill routines end all sentences with double spaces.
  1502. dragAndDrop       Ñ Enable drag and drop.
  1503. fontSize       Ñ Default size of fonts used to display 
  1504.                  files.
  1505. forceMainScreenÑ If true, forces windows to main screen. Useful if you 
  1506.                  have a small screen and windows habitually are too large.
  1507. horScrollBar   Ñ If set, use horizontal scrollbar.
  1508. iconifyOnSwitchÑ Iconify all windows when suspending.
  1509. infoWindowsDirtyÑ Dirty/Clean state of description windows.
  1510. intelCutPaste  Ñ Enable intelligent cut and paste.
  1511. lockStatus       Ñ Disable status window dragging.
  1512. moveInsertion  Ñ if true, 'pageBack' and 'pageForward'
  1513.                  move the insertion point
  1514. numWinsToTile  Ñ specifies the number of windows tile
  1515.                  commands should affect.
  1516. paraColumn     Ñ Alpha automatically wraps files
  1517.                 that contains lines longer than this. 
  1518. powerThumb       Ñ If true, vertical scrollbars have power thumbs.
  1519. printerFont       Ñ Font to print documents.
  1520. printerFontSizeÑ Size to print documents.
  1521. projectorAware Ñ Respect projector resources.
  1522. savedState       Ñ set to either "mpw", "think", or "none" depending on how 
  1523.                  much information you wish Alpha to save in the resource 
  1524.                  fork of the files you edit. See the "Files" section of 
  1525.                  this file for more information.
  1526. showInvisibles Ñ Show spaces, tabs, crs.
  1527. sortColumn     Ñ column to use for sort routine.
  1528. sortedIsDefaultÑ if set, sorted is the default for 
  1529.                  function and section menus.
  1530. sortFuncsMenu  Ñ Whether or not to sort the funcs menu.
  1531. tagFile        Ñ complete path-name of tag file
  1532. tearoffMenus   Ñ toggles tear-off menus.
  1533. tile{Height,Left,Top,Width} Ñ rectangle to tile windows
  1534.                  within.
  1535. tempMem        Ñ Enable use of system temporary memory.
  1536. undoOn         Ñ used to turn undo on and off. When undo
  1537.                  is turned off, all undo info is lost.
  1538.                  Useful when doing global replaces, etc.
  1539. wrapHigh       Ñ Line length limit beyond which soft-wrapping occurs, if 
  1540.                  enabled.
  1541. wrapLow           Ñ      ""            ""
  1542.  
  1543.  
  1544.           Spellchecking
  1545.  
  1546. Alpha has the capability to interact with the spell-check 'Excalibur', 
  1547. written by Robert Gottshall and Rick Zaccone.  The menu item 'Spellcheck 
  1548. Window' is always available in the "Utils" menu.  Selecting this item will 
  1549. start up Excalibur and send an OpenDoc event describing the current window.  
  1550. For version 1.4 and earlier, if Alpha has to launch Excalibur you will need 
  1551. to dismiss Excalibur's opening dialog by hitting the Cancel button.  
  1552. Subsequent selections of the menu item will switch right into Excalibur 
  1553. with the correct file displayed.  In future versions, this will become even 
  1554. more automatic.
  1555.  
  1556. Excalibur is free, but not in the public domain.  It can be obtained from 
  1557. all the usual Internet ftp sites, as well as cs.umd.edu under 
  1558. pub/faculty/keleher/Alpha.
  1559.  
  1560.  
  1561.           International Users
  1562.  
  1563. There is a basic problem international users will notice, which have to do 
  1564. with the fact that the keyboard layout is different in different countries. 
  1565. Therefore some keybindings in Alpha may not work with all keyboards. For 
  1566. example, on a Swiss keyboard, '/' is shift-7 (which means you have to press 
  1567. shift to get '/'. This means there is no difference between cmd-/ and 
  1568. shift-cmd-/ on such a keyboard. In Alpha these are bound separately to 
  1569. 'zoom' and 'singlePage'.
  1570.  
  1571. If you're using a western keyboard Alpha can solve this problem for you.
  1572.  
  1573. First: Activate the internationalMenus feature.  It replaces some 
  1574. keybindings in the menus and solves problems like the one just described.
  1575.  
  1576. Second: Tell Alpha which keyboard layout you're using in the prefs dialog 
  1577. Config:Global:Preferences:International. (In a future version, Alpha should 
  1578. be able to get this information from the OS directly.) This will make sure 
  1579. that also bindings not defined in the menus work, e.g. that the electric 
  1580. braces work.
  1581.  
  1582. If you're not using a western keyboard or if you do encounter any problems, 
  1583. reading the following section will help to clarify things and should help 
  1584. you to fix the problem.
  1585.  
  1586. To solve the problem with bindings in the menus you can use the 
  1587. menu::replaceWith command. To solve the problem with the Swiss keyboard 
  1588. described above you would add the following to your prefs file:
  1589.    
  1590.     menu::replaceWith winMenu [list "//<Szoom" "//<S<I<OsinglePage"] \
  1591.         items "<S//zoom" "<S<O<U/=singlePage"
  1592.  
  1593. To define your keyboard layout, add a line like this to your prefs file:
  1594.  
  1595.     set "keyboards(U.S.)" {
  1596.      {ñ1234567890-=[];'\`,./}
  1597.      {▒!@#$%^&*()_+{}:"|~<>?}
  1598.      <U/[
  1599.      <U/]
  1600.     }
  1601.  
  1602. which contains four strings which Alpha uses to set these internal 
  1603. variables:
  1604.  
  1605.     keys::mapShiftBindFrom "`1234567890-=[]\;',./"
  1606.     keys::mapShiftBindTo   "~!@#$%^&*()_+{}|:"<>?"
  1607.     bind::leftBrace <U/[
  1608.     bind::rightBrace <U/]
  1609.  
  1610. which tell Alpha how to map using the 'shift' key.  Therefore on
  1611. an American keyboard, shift maps each item in the upper string into
  1612. the corresponding item in the lower string.  Set these strings up
  1613. and then any bindings you set will work ok. 
  1614.  
  1615. See the file alphaDefinitions.tcl for examples of keyboard layout 
  1616. definitions.
  1617.  
  1618. If you define an array entry keyboards(my-country), then you can just 
  1619. select that in the international prefs dialog, and Alpha will set the
  1620. flags correctly.  You can then send that keyboard array entry to the 
  1621. ALPHA-D mailing list (see Readme for details) for inclusion in a 
  1622. future version of Alpha.
  1623.  
  1624. If any other package defines bindings which depend upon these 
  1625. variables, you will need to restart Alpha after messing with the variables.
  1626. If a package wishes to be told when the keyboard changes, it can do 
  1627. that by registering with the 'removekeyboard' or 'keyboard' hooks like
  1628. this:
  1629.  
  1630.     # tell me when we switch to a "Swiss German" keyboard
  1631.     hook::register keyboard keys::swiss "Swiss German"
  1632.     # tell me when we disable a keyboard
  1633.     hook::register removekeyboard my_disable_proc
  1634.     # tell me when we enable a keyboard
  1635.     hook::register keyboard my_enable_proc
  1636.     
  1637. In this way a clever package could remove the need for restarting 
  1638. Alpha by unbinding and then rebinding all necessary items.
  1639.  
  1640.           Drag and Drop
  1641.  
  1642. Alpha supports drag and drop cut, copy, clear, and paste. To use this 
  1643. feature, select some text, then move the cursor over the selected text. 
  1644. The cursor should then turn into an open hand. Mouse down, and move the 
  1645. cursor to the place you wish to paste the text. When the mouse is 
  1646. released, the hilited text is moved to the new location.
  1647.  
  1648. Option-mouse does a "copy" instead. You can also drag selections between 
  1649. windows and to and from other applications, including the finder. Text 
  1650. can be deleted by dragging it to the trash can. 
  1651.  
  1652. You MUST have system 7.5 or above or Apple's "Macintosh Drag And Drop" 
  1653. installed. Get a copy from Apple or via Alpha's web page.
  1654.  
  1655.  
  1656.  
  1657.           Status Bar
  1658.  
  1659. The stripe across the bottom of the screen is a floating window that 
  1660. displays status information, certain prompts (option-x, and see the func 
  1661. 'statusPrompt'), and the current row and column.
  1662.  
  1663. You can't make this window go away. However, both 'sizeWin' and 'moveWin' 
  1664. accept "StatusWin" as a window specification and will act on this window, 
  1665. so you can move the window offscreen if you really wish. The height
  1666. parameter to 'sizeWin' is ignored.
  1667.  
  1668. The status bar can be dragged if the flag 'lockStatus' is turned off.
  1669.  
  1670. Clicking over the row and column indicators allows you to jump to a 
  1671. particular line.
  1672.  
  1673. The left-most popup menu allows you to choose the type of wrapping when 
  1674. typing.
  1675.  
  1676. The second popup menu is the "File Flags" menu.  The next icon is the 
  1677. "Mode" popup menu, which shows the window's current mode and allows it to 
  1678. be changed.
  1679.  
  1680. Finally, if you turn horizontal scrollbars off (via the 'horScrollBar' flag 
  1681. in the "Config:Global:Preferences:Window" dialog, you haven't lost any real 
  1682. estate. Furthermore, when tiling windows vertically, you actually have 
  1683. *more* real estate.
  1684.  
  1685.  
  1686.           Modes
  1687.  
  1688. Each window in Alpha is always in a single "mode", such as the "C++" mode, 
  1689. or the "TeX" mode.  A mode describes bindings and variable values 
  1690. particular to that mode.  The mode of the frontmost window is displayed and 
  1691. can be changed via the status bar.
  1692.  
  1693. Alpha sets modes for new windows based on file name suffixes.  For 
  1694. instance, "files.c" is started up in mode "C++" because of the ".c" suffix.  
  1695. Below are some examples of standard suffixes recognized by Alpha.  These 
  1696. suffixes can be changed via the 'Suffix Mappings╔' item in the "Config" menu. 
  1697. The default mode is "Text".
  1698.  
  1699.     .r                                C
  1700.     .cc, .cp, .cpp, .CPP, .C        C++
  1701.     .f .fcm .for .FOR                Fort
  1702.     .tcl                            Tcl
  1703.     .tex, .sty, .ltx, .dtx, .ins    TeX
  1704.     .pl                                Perl
  1705.     .html .htm                        HTML
  1706.     
  1707. Bindings for a specific mode can be specified by passing the desired mode as 
  1708. the last argument to a 'Bind' command (see "Key Bindings").
  1709.  
  1710. Alpha has two different types of immediately visible flags and variables: 
  1711. global and per-mode flags. These can be changed in separate submenus under the 
  1712. Config menu.
  1713.  
  1714. "Mode" flags and variables are instantiated separately for each mode.  
  1715. These are inspected and set via the "Config:Current Mode" menu.  Changing 
  1716. these values affects every window in that mode, but doesn't affect windows 
  1717. in other modes.
  1718.  
  1719. The variables displayed in "Config:Current Mode" are all the variables that 
  1720. the current mode cares about. The "Config:Current Mode:Menus And Features╔" 
  1721. item allows you to specify which of the extra menus should be present 
  1722. whenever the frontmost window is in that mode.
  1723.  
  1724. See here for more information on defining your own modes.
  1725.  
  1726. See here for information on removing existing modes (for disk space).
  1727.  
  1728.         Features
  1729.         
  1730. Alpha has a very flexible mechanism for adding extensions. There are many 
  1731. extensions included in the basic Alpha distribution. Others can be 
  1732. downloaded from one of Alpha's internet sites (there are now more than 
  1733. thirty such packages available). The 'Config:Package Prefs' menu allows you to 
  1734. update modes, menus, and extensions quickly and easily by downloading small 
  1735. update files from the internet. 
  1736.  
  1737. You can customize Alpha by activating and deactivating these extra 
  1738. features. They come in two flavors, "menus" and "features". A "menu" is a 
  1739. stand-alone menu which is attached to the menu bar, while a "feature" is 
  1740. some functionality which doesn't have a menu connected to it. However, some 
  1741. features add a submenu or menu items to a submenu. Thus, there is only a 
  1742. technical difference between "menus" and "features". They both give you 
  1743. some additional functionality.
  1744.  
  1745. You activate the extra menus and features by using the menu item 
  1746. "Config:Preferences:Menus And Features╔" 
  1747.  
  1748. See here for more information on how to write your own menus and features.
  1749.  
  1750. Click here for a list of all installed menus, features, and modes.
  1751.  
  1752.         
  1753.  
  1754.           File Comparison
  1755.  
  1756. Alpha can create UNIX "diffs" of two text files. Among other things, diffs 
  1757. allow you to easily pinpoint what has changed between two different 
  1758. versions of the same file.
  1759.  
  1760. Alpha's interface (under the "Utils" menu) allows you to compare either the 
  1761. two topmost windows, or two arbitrary files or entire folders). Alpha opens 
  1762. the two files in windows at the top of the screen with the diff file at the 
  1763. bottom. You can navigate between individual differences in the diff file by 
  1764. using the Up and Down arrows. Pressing either a carriage return or the 
  1765. Enter key displays the affected portions of the two files in the above 
  1766. windows.
  1767.  
  1768. I'm currently using a hack of QUED's GNU diff port.  My hack allows 
  1769. it to work as an AppleEvent server.  However, it handles most errors by 
  1770. quitting without responding, and handles only a single message before 
  1771. quitting. It also doesn't deal with folders. 
  1772.  
  1773. The interface is a 'dosc' script event containing the command-line 
  1774. arguments that would be used in running 'diff' from a UNIX shell (see 
  1775. here).  The result is the diff.  On the command line, file names containing 
  1776. spaces can be specified by delimiting the entire file name with double 
  1777. quotes.  The source for my version of the diff application (crude though it 
  1778. is), is available in pub/faculty/keleher/Alpha on cs.umd.edu.
  1779.  
  1780. Bugs: The files must have line Mac terminations.
  1781.  
  1782.  
  1783.  
  1784.           HyperText
  1785.  
  1786. Alpha's hypertext is both more and less powerful than systems that use 
  1787. markup languages such as HTML. It's more powerful because the action 
  1788. taken upon hitting a hypertext link is any arbitrary Tcl script rather 
  1789. than just navigation. It's less powerful because the generality doesn't 
  1790. allow a standard notion of going "back" or "forward". In any case, two 
  1791. points:
  1792.     1) The hypertext is only intended for Alpha documentation, and links 
  1793.     should not need to be created by anyone who isn't writing docs.
  1794.     
  1795.     2) 'pushMark' is called before any hypertext link is executed. This 
  1796.        allows you to return to the previous spot by "Pop Mark"ing (from the 
  1797.        Edit menu).
  1798.     
  1799. If you *must* create hypertext links, use the insertColorEscape command.
  1800.  
  1801.  
  1802.  
  1803.           Limitations
  1804.  
  1805. - Apple's listproc seems to have a total size limit of 32k characters. 
  1806.   This effectively limits tag searches to about 4000 function names.
  1807.  
  1808.  
  1809.           Preferences
  1810.  
  1811. Alpha saves settings between sessions by writing them to files in an 
  1812. "Alpha" sub-folder of the system preferences folder.  Additionally, Alpha 
  1813. will source a file called "prefs.tcl" from this sub-folder if it exists.  
  1814. You can view or remove the settings currently being saved there at any time 
  1815. via the "View/Remove Saved Settings╔" from the Edit menu. You can edit 
  1816. the prefs.tcl file via the "Config:Global:Edit Prefs File" item. 
  1817.  
  1818. Never add manually add text to the defs.tcl or arrdefs.tcl files in the 
  1819. preferences folder. These files are automatically generated and read by 
  1820. the addDef etc. functions. If you need to save variable definition from 
  1821. Tcl code, addDef etc. is your friend. 
  1822.  
  1823. If you want to have arbitrary code executed on startup, you can manually 
  1824. place this in the prefs.tcl file.
  1825.  
  1826. Holding down the shift key at startup causes Alpha to skip all preferences 
  1827. files.
  1828.  
  1829.  
  1830.           Changing Alpha's Behavior
  1831.  
  1832. Alpha's behavior can be modified in five primary ways. The first is by 
  1833. changing flag and variable values. Mode-independent flags and variables are 
  1834. under the "Config:Preferences" menu. Mode-dependent flags and 
  1835. variables are in "Config:Mode Prefs:Preferences". Values of all of these 
  1836. flags and variables are saved when Alpha exits.
  1837.  
  1838. The second method is to write an 'extension'. See the 'Extending Alpha' 
  1839. help file for details. Extensions are conveniently packaged pieces of Tcl 
  1840. code which have a startup section and a main section and are labelled via a 
  1841. name and version number. They may be conveniently turned on or off using 
  1842. the Packages menu, and can be distributed to other Alpha users without the 
  1843. requirements for complex installation instructions.
  1844.  
  1845. The third method is to add bindings or Tcl procs to 'prefs.tcl', Alpha's 
  1846. preference file.  This file is accessible from the "Config" menu as well.  
  1847. 'prefs.tcl' is sourced at the end of Alpha's startup procedure.
  1848.  
  1849. The fourth way to modify Alpha's behavior is to create mode-specific prefs 
  1850. files. These files are created through the Config menu. Mode-specific prefs 
  1851. are loaded after the corresponding mode has been entered for the first 
  1852. time.
  1853.  
  1854. The final recommended way to modify Alpha is to create files that are 
  1855. sourced after corresponding files in Alpha's :Tcl:SystemCode folder. See 
  1856. here for more details.
  1857.  
  1858. Finally, you could just hack the files in SystemCode directly. However, 
  1859. you should definitely know what you are doing if you resort to this method, 
  1860. and it's definitely *not* portable from one version of Alpha to the next.
  1861.  
  1862.  
  1863.  
  1864.           Internet Config
  1865.  
  1866. "Internet Config" is a freeware utility that holds system-wide preferences, 
  1867. especially preferences that might be accessed by more than one 
  1868. application.  For example, Internet Config stores pointers to helpers for 
  1869. web services, ftp, etc.  
  1870.  
  1871. Alpha supports "Internet Config" in the following ways: (i) 
  1872. command-clicking on highlighted text causes the text to be sent to Internet 
  1873. Config to be launched, (ii) the Internet Config menu allows either Internet 
  1874. Config itself, or several of it's internet helpers, to be started, and iii) 
  1875. Alpha can query Internet Config for path names in the "Config:Helper Apps╔" 
  1876. dialog. 
  1877.  
  1878. Click here for more information.  Once you have installed it and set up 
  1879. your ftp helper app through Internet Config, you can retrieve the entire 
  1880. package by clicking here.
  1881.  
  1882. The "URLs" submenu allows you to store a few commonly used URLs and to 
  1883. launch them, regardless of what helper they are directed to.
  1884.  
  1885. For instance, my menu includes 
  1886.  
  1887. New York Times       "http://www.nytimes.com/info/contents/contents.html"
  1888. Latest TCL Source    "ftp://ftp.aud.alcatel.com/tcl/ftp.smli.com/mac/"
  1889. Down                 "ftp://keleher:passwd@cs.umd.edu/down/"
  1890.  
  1891. where 'passwd' is replaced by my real password (and is understood by 
  1892. Anarchy, among others).
  1893.  
  1894. The function icURL can be to send URLs to internet config. For instance, I 
  1895. have the following proc defined in my prefs that allows me to access any 
  1896. arbitrary directory of my unix box at school merely by typing "ftp <dir>":
  1897.  
  1898.     proc ftp {{arg ""}} {
  1899.         icURL "ftp://keleher:passwd@cs.umd.edu/$arg"
  1900.     }
  1901.  
  1902. The 'Finger' item sends a fetchurl event to Peter Lewis's "Finger" program. 
  1903.  
  1904.  
  1905.           Calculator
  1906.  
  1907. Alpha now has its own calculator :-), entirely implemented in Tcl.  This is 
  1908. just a quick-and-dirty RPN stack calculator, works on both signed and
  1909. unsigned decimals, hex integers, and floating point.  I put it together for 
  1910. my own use, not yours, but feel free to use it as long as you don't complain 
  1911. about what it doesn't do. Improvements, of course, are welcome.
  1912.  
  1913. Operations:                                                             
  1914.     +,-,*,/,|,&,%    Top    of stack is    'y', next is 'x'. Does x OP    y.     
  1915.     ~                bitwise NOT                                         
  1916.     ^                x eor y                                             
  1917.     <                x << y                                             
  1918.     >                x >> y                                             
  1919.     c                change y's sign                                     
  1920.     q                dup    y                                             
  1921.     i                swap x and y                                     
  1922.     m                switch signed/unsigned/hex modes                         
  1923.     x                show current mode
  1924.     h or ?            help
  1925.     <delete>        pop    stack                                         
  1926.     <space>            enter number                                     
  1927.  
  1928. Invoke from the File menu, holding down the shift key.
  1929.  
  1930.  
  1931.  
  1932.           Templates
  1933.  
  1934. Temporary marks can also be used to construct templates.  
  1935. The file "templates.tcl" contains basic template support, and the 
  1936. Vince's Additions package (an extension you may download) provides a 
  1937. more feature rich version.  Templates are pieces of code/text with
  1938. predefined 'template-stops' at which the user will want to enter 
  1939. information.  For instance, in C mode, you can save a lot of typing by 
  1940. using 'for' templates, which insert 'for (Ñ;Ñ;Ñ) { Ñ }'.  By default 
  1941. 'tab' and 'shift-tab' are used to move forwards and backwards between 
  1942. the bullets (which are the template-stops).
  1943.  
  1944. As of Alpha 7.0, the old 'electricAlias' package no longer functions 
  1945. correctly.  It would be relatively easy for a user to fix it up to
  1946. work again.  However, similar functionality is provided via Alpha's new 
  1947. built-in templates and extended by Vince's Additions, so you'll
  1948. probably be happy just to use them.
  1949.  
  1950. NOTE: TO USE TEMPLATES YOU MUST SET YOUR ELECTRIC TAB PREFERENCE!
  1951. Otherwise the tab key will just insert a tab (surprise, surprise).
  1952. There is a global setting, and some modes have their own setting
  1953. which will over-ride the global one.
  1954.  
  1955. If your code needs to insert templates, you should use the following
  1956. procedures:
  1957.  
  1958.     elec::Insertion {args}
  1959.     elec::CenterInsertion {args}
  1960.     elec::ReplaceText {start end args}
  1961.     elec::Wrap {left right}
  1962.  
  1963. These all do the 'obvious' thing.  The only non-obvious point is
  1964. that the template-text you give these procedures should mark its
  1965. template stops (bullets 'Ñ') with DOUBLE BULLETS 'ÑÑ'.  So a 'for'
  1966. template is "for (ÑÑ;ÑÑ;ÑÑ) \{ ÑÑ \}".  Why, you may ask?  This
  1967. is because more advanced template mechanisms can put more information
  1968. between the bullets.  The simplest such instance you may wish to
  1969. support is to put a descriptive name for the template stop inbetween:
  1970. "for (ÑstartÑ;ÑtestÑ;ÑincrementÑ) \{ Ñloop bodyÑ \}"
  1971.  
  1972.           Ftp Browser
  1973.  
  1974. The 'FTP' menu allows quick access to files on a remote ftp server, useful 
  1975. for those that work on both unix and mac systems. You should have Anarchie 
  1976. or Fetch installed as your ftp client. Popup menu in title of any "remote" 
  1977. window allows repeated access to those directories.
  1978.  
  1979. More docs later, once someone sends them to me. Please volunteer....
  1980.  
  1981.  
  1982.  
  1983.  
  1984.           Deconstructing Alpha
  1985.  
  1986. Use the 'Config:Package Prefs:Uninstall A Package╔' menu item to remove modes 
  1987. menus or extensions you don't use to save disk space. This *permanently* 
  1988. removes tcl and help files pertaining to the offending modes and menus. 
  1989. Only a re-installation can get them back.
  1990.  
  1991.  
  1992.  
  1993. Remember, Alpha's official home site is:
  1994.  
  1995.         http://www.bcity.com/alphatext
  1996.  
  1997.